package com.example.android.google.apis;

import com.example.android.apis.view.MapViewCompassDemo;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

public class MainActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);

		final Button button = (Button) findViewById(R.id.go_button);
		button.setOnClickListener(new OnButtonClick());
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.activity_main, menu);
		return true;
	}

	private class OnButtonClick implements View.OnClickListener {

		public void onClick(View v) {
			Toast.makeText(MainActivity.this, "click!", Toast.LENGTH_LONG)
					.show();	
			Intent intent = new Intent(MainActivity.this, MapViewCompassDemo.class);
			MainActivity.this.startActivity(intent);
		}
	}
}
